/**
 * Created by Dalyn on 2017/3/28.
 */
import Relay from "react-relay";

export default class getGoodsCatalogMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { getGoodsCatalog }`;
    }

    getVariables() {
        return {
            argsInput: {
                level: this.props.level,
                token: this.props.token,
                parentId: this.props.parentId,
                name:this.props.name,
                categoryId:this.props.categoryId,
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on getGoodsCatalogPayload {
            responseData {  
                errorCode
                value
                totalResult
                id
                goodsInfoCatalogModel{
                    level
                    name
                    categoryId
                    parentId
               
                }
                goodsInfoCatalogModelList{
                    level
                    name
                    categoryId
                    parentId
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
                fragment on getGoodsCatalogPayload {
                    responseData {
                        errorCode
                        value
                        totalResult
                        id
                        goodsInfoCatalogModel{
                            level
                            name
                            categoryId
                            parentId
               
                        }
                        goodsInfoCatalogModelList{
                            level
                            name
                            categoryId
                            parentId
                        }
                        
                    }
                }
            `]
        }];
    }

}